package com.yifang.yibingproject.exception;


import com.yifang.yibingproject.utils.ErrorCode;

public class DetailException extends RuntimeException implements ErrorCode {
    private final ErrorCode errorCode;

    public DetailException(ErrorCode errorCode) {
        super("code:" + errorCode.getCode() + ",msg:" + errorCode.getMsg());
        this.errorCode = errorCode;
    }

    @Override
    public int getCode() {
        return this.errorCode.getCode();
    }

    @Override
    public String getMsg() {
        return this.errorCode.getMsg();
    }
}
